From: Andrew Cooper Date: Mon, 19 Dec 2016 10:19:29 +0000 (+0000) Subject: x86/emul: Don't opencode CR0_TS in CLTS handling X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3101 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:///%22http:/www.example.com/cgi/%22https:/?a=commitdiff_plain;h=eafc8ad471de861132b15e3268f72517c128a298;p=xen.git x86/emul: Don't opencode CR0_TS in CLTS handling Also replace implicit 0 checks with X86EMUL_OKAY Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index be6904ff2a..34a511be0c 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -4703,8 +4703,8 @@ x86_emulate( case X86EMUL_OPC(0x0f, 0x06): /* clts */ generate_exception_if(!mode_ring0(), EXC_GP, 0); fail_if((ops->read_cr == NULL) || (ops->write_cr == NULL)); - if ( (rc = ops->read_cr(0, &dst.val, ctxt)) || - (rc = ops->write_cr(0, dst.val&~8, ctxt)) ) + if ( (rc = ops->read_cr(0, &dst.val, ctxt)) != X86EMUL_OKAY || + (rc = ops->write_cr(0, dst.val & ~CR0_TS, ctxt)) != X86EMUL_OKAY ) goto done; break;